package com.orhon.smartcampus.modules.systemctl.mm;


import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.DictionaryMapper;
import com.orhon.smartcampus.modules.base.mm.GradeMapper;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.base.mm.SchoolMapper;
import com.orhon.smartcampus.modules.base.mm.SubjectMapper;
import com.orhon.smartcampus.modules.systemctl.entity.OrgDepartmentUserRelation;
import com.orhon.smartcampus.modules.systemctl.gqlModel.GQLDepartmentUsers;
import com.orhon.smartcampus.modules.user.mm.UserMapper;


@Mapper(uses = {
        DictionaryMapper.class,
        LangMapper.class,
        UserMapper.class,
        SubjectMapper.class,
        GradeMapper.class,
        SchoolMapper.class
        
})
public interface DepartmentUserMapper {

    DepartmentUserMapper MAPPER = Mappers.getMapper(DepartmentUserMapper.class);

    @Mapping(source = "id" , target = "id")
    @Mapping(source = "isLeaders" , target = "is_leaders")
    @Mapping(source = "leaveAt" , target = "leave_at")
    @Mapping(source = "depDuty" , target = "dep_duty")
    @Mapping(target = "department" , ignore = true)
    @Mapping(target = "duty" , ignore = true)
    @Mapping(target = "user" , ignore = true)
    //@Mapping(target = "user_name" , ignore = true)
    GQLDepartmentUsers toOrgDepartmentUserRelation(OrgDepartmentUserRelation entity);
    
    @InheritConfiguration(name = "toOrgDepartments")
    List<GQLDepartmentUsers> toOrgDepartmentUserRelationList(List<OrgDepartmentUserRelation> entities);

}
